home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk UserVolume 4 #7 / Commodore_Disk_User_Vol.4_7_1991_-.d64 / m_c 64-tel (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  12KB  |  717 lines

  1. 1000 ! this is the code for 64-tel
  2. 1010 ! that mimics teletext through
  3. 1020 ! the use of the disk drive
  4. 1030 !
  5. 1040 *=$9000,$6000
  6. 1050 !
  7. 1060 ! initialise
  8. 1070 lda #15   ! open ext. sound
  9. 1080 sta $d418 ! and set up 'beep'
  10. 1090 lda #100
  11. 1100 sta $d400
  12. 1110 sta $d401
  13. 1120 lda #0
  14. 1130 sta $d405
  15. 1140 lda #240
  16. 1150 sta $d406
  17. 1160 lda #$20
  18. 1170 sta $d404
  19. 1180 lda #$80      ! auto repeat
  20. 1190 sta 650
  21. 1200 jsr $e544  ! clear screen
  22. 1210 lda #0
  23. 1220 sta $d020
  24. 1230 sta $d021
  25. 1240 lda #<title   ! display title
  26. 1250 ldy #>title
  27. 1260 jsr $ab1e
  28. 1270 ldx #5        ! date & time input
  29. 1280 stx di
  30. 1290 dat lda di
  31. 1300 asl a
  32. 1310 tax
  33. 1320 lda adt,x    ! address table
  34. 1330 ldy adt+1,x
  35. 1340 jsr $ab1e    ! print message
  36. 1350 jsr ino     ! get number input
  37. 1360 php
  38. 1370 pha
  39. 1380 lda #<cl
  40. 1390 ldy #>cl
  41. 1400 jsr $ab1e
  42. 1410 pla
  43. 1420 plp
  44. 1430 bcc dt2
  45. 1440 jmp dat
  46. 1450 bdc clc ! binary to dec conv.
  47. 1460 sed
  48. 1470 lda #0
  49. 1480 bd1 adc #1
  50. 1490 dey
  51. 1500 bne bd1
  52. 1510 cld
  53. 1520 rts
  54. 1530 dt2 ldx di
  55. 1540 sta dtt,x ! date & time table
  56. 1550 ldy #152
  57. 1560 dd1 dex  ! delay
  58. 1570 bne dd1
  59. 1580 dey
  60. 1590 bne dd1
  61. 1600 dec di
  62. 1610 bpl dat
  63. 1620 ldx #5         ! set up clock
  64. 1630 dt3 lda #0
  65. 1640 ldy dtt,x
  66. 1650 beq dt5
  67. 1660 jsr bdc        ! bin > dec conv.
  68. 1670 dt5 sta $dc06,x
  69. 1680 dex
  70. 1690 cpx #2
  71. 1700 bne dt3
  72. 1710 lda #0
  73. 1720 sta $dc08
  74. 1730 lda $dc08
  75. 1740 sei
  76. 1750 lda #$7f  ! kill timer irq
  77. 1760 sta $dc0d
  78. 1770 sta $dd0d
  79. 1780 lda #<irq  ! set up raster int.
  80. 1790 sta $314
  81. 1800 lda #>irq
  82. 1810 sta $315
  83. 1820 lda #$81
  84. 1830 sta $d01a
  85. 1840 lda #57
  86. 1850 sta $d012
  87. 1860 lda $d011
  88. 1870 and #$7f
  89. 1880 sta $d011
  90. 1890 cli
  91. 1900 jmp main       ! to main prog.
  92. 1910 ino jsr gen    ! get a digit no.
  93. 1920 sta ten        ! tens
  94. 1930 jsr gen
  95. 1940 sta un         ! units
  96. 1950 jsr evn        ! evalute no.
  97. 1960 ldx di
  98. 1970 sec
  99. 1980 cmp lmu,x      ! upper no. limit
  100. 1990 bcs in1
  101. 2000 cmp lml,x
  102. 2010 bcs in2
  103. 2020 sec
  104. 2030 in1 rts
  105. 2040 in2 clc
  106. 2050 jmp in1
  107. 2060 gend jsr $ffe4   ! slightly differ
  108. 2070 cmp #$30
  109. 2080 bmi gend
  110. 2090 cmp #$3a
  111. 2100 bpl gend
  112. 2110 pha
  113. 2120 jmp cgen       ! continue
  114. 2130 gen jsr $ffe4  ! get a keypress
  115. 2140 cmp #$30
  116. 2150 bmi gen
  117. 2160 cmp #$3a       ! was it 0 - 9 ?
  118. 2170 bpl gen
  119. 2180 pha
  120. 2190 jsr $e716
  121. 2200 cgen lda #$21   ! sound 'beep'
  122. 2210 sta $d404
  123. 2220 ldy #20
  124. 2230 gn1 dex
  125. 2240 bne gn1
  126. 2250 dey
  127. 2260 bne gn1
  128. 2270 lda #$20
  129. 2280 sta $d404
  130. 2290 pla
  131. 2300 sbc #$2f       ! asc to real value
  132. 2310 rts
  133. 2320 evn lda un
  134. 2330 ldx ten
  135. 2340 beq ev2
  136. 2350 clc
  137. 2360 ev adc #10
  138. 2370 dex
  139. 2380 bne ev
  140. 2390 ev2 rts
  141. 2400 title byt 13,142
  142. 2410 byt "[156]welcome to ...",13
  143. 2420 byt "          [166][166][166]  [166]  [166]       [158] tel   ",13
  144. 2430 byt "         [166]     [166]  [166]              ",13
  145. 2440 byt "         [166][166][166][166]  [166]  [166]    [213][201]  tel   ",13
  146. 2450 byt "         [166]   [166] [166][166][166][166][166][166]  [202][203]        ",13
  147. 2460 byt "         [166]   [166]    [166]       [158] tel   ",13
  148. 2470 byt "          [166][166][166]     [166] ",13,0
  149. 2480 cl byt "[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]",0
  150. 2490 tl byt "[147]",14,"[158]p100  64-tel   23 jan '90  [158]00:00:00  [156]   [146]",0
  151. 2500 mon byt "janfebmaraprmayjunjulaugsepoctnovdec"
  152. 2510 m0 byt " enter date (01-31)  :  [157][157]",0
  153. 2520 m1 byt " enter month (01-12) :  [157][157]",0
  154. 2530 m2 byt " enter year (90-99)  :  [157][157]",0
  155. 2540 m3 byt " time seconds (00-59):  [157][157]",0
  156. 2550 m4 byt " time minutes (00-59):  [157][157]",0
  157. 2560 m5 byt " time hours (01-12)  :  [157][157]",0
  158. 2570 di byt 0
  159. 2580 cp byt 0
  160. 2590 ten byt 0
  161. 2600 un byt 0
  162. 2610 lmu byt 32,13,100,60,60,13
  163. 2620 lml byt 1,1,90,0,0,1
  164. 2630 adt wor m0,m1,m2,m3,m4,m5
  165. 2640 dtt byt 0,0,0,0,0,0
  166. 2650 bam byt 66
  167. 2660 index byt 100
  168. 2670 !
  169. 2680 irq lda $d019
  170. 2690 sta $d019
  171. 2700 jmp ir2
  172. 2710 ire pla
  173. 2720 tay
  174. 2730 pla
  175. 2740 tax
  176. 2750 pla
  177. 2760 rti
  178. 2770 ir2 lda irt  ! irq toggle
  179. 2780 eor #1
  180. 2790 sta irt
  181. 2800 tax
  182. 2810 lda $d018    ! which screen
  183. 2820 and #15
  184. 2830 ora wcs,x
  185. 2840 sta $d018
  186. 2850 lda irl,x    ! next ras. line
  187. 2860 sta $d012
  188. 2870 ldy #31
  189. 2880 srp dey     ! slight raster pause
  190. 2890 bne srp
  191. 2900 lda irc,x    ! screen col?
  192. 2910 sta $d021
  193. 2920 dex
  194. 2930 bne ir3
  195. 2940 jmp $ea31
  196. 2950 ir3 lda $7e9    ! flash mode ?
  197. 2960 bne ir5     ! yes
  198. 2970 ldx ro
  199. 2980 bne irr
  200. 2990 lda #$10
  201. 3000 jmp irr2
  202. 3010 irr lda #$20
  203. 3020 irr2 sta wcs+1
  204. 3030 jmp ir4
  205. 3040 ir5 dec fr  ! flash rate
  206. 3050 beq ir6
  207. 3060 jmp ir4
  208. 3070 ir6 lda #50
  209. 3080 sta fr
  210. 3090 lda wcs+1
  211. 3100 eor #$30
  212. 3110 sta wcs+1   ! toggle
  213. 3120 jmp ir4
  214. 3130 pb byt $10,$20
  215. 3140 fr byt 0
  216. 3150 st byt 0
  217. 3160 ro byt 0
  218. 3170 ir4 dec ud   ! update delay
  219. 3180 bne ire
  220. 3190 lda #10
  221. 3200 sta ud
  222. 3210 lda $dc0b
  223. 3220 and #$7f
  224. 3230 jsr dsp     ! decimal split
  225. 3240 sta $41b
  226. 3250 sty $41c    ! display clock
  227. 3260 lda $dc0a
  228. 3270 jsr dsp
  229. 3280 sta $41e
  230. 3290 sty $41f
  231. 3300 lda $dc09
  232. 3310 jsr dsp
  233. 3320 sta $421
  234. 3330 sty $422
  235. 3340 lda $dc08
  236. 3350 ! flash & rest
  237. 3360 jmp ire
  238. 3370 dsp pha        ! decimal split
  239. 3380 and #15
  240. 3390 clc
  241. 3400 adc #$30
  242. 3410 tay
  243. 3420 pla
  244. 3430 lsr a
  245. 3440 lsr a
  246. 3450 lsr a
  247. 3460 lsr a
  248. 3470 clc
  249. 3480 adc #$30
  250. 3490 rts
  251. 3500 irt byt 0
  252. 3510 irc byt 0,0
  253. 3520 irl byt 55,239
  254. 3530 wcs byt 16,16
  255. 3540 ud byt 0
  256. 3550 main lda #<tl  ! top line
  257. 3560 ldy #>tl
  258. 3570 jsr $ab1e
  259. 3580 ldy dtt ! get date
  260. 3590 jsr bdc
  261. 3600 jsr dsp
  262. 3610 sta $40f
  263. 3620 sty $410
  264. 3630 ldy dtt+2  ! get year
  265. 3640 jsr bdc
  266. 3650 jsr dsp
  267. 3660 sta $417
  268. 3670 sty $418
  269. 3680 lda #0
  270. 3690 ldx dtt+1  ! get month
  271. 3700 dex
  272. 3710 beq mn3
  273. 3720 clc
  274. 3730 mn2 adc #3
  275. 3740 dex
  276. 3750 bne mn2
  277. 3760 tax
  278. 3770 mn3 clc
  279. 3780 lda mon,x
  280. 3790 and #$bf
  281. 3800 sta $412
  282. 3810 lda mon+1,x
  283. 3820 and #$bf
  284. 3830 sta $413
  285. 3840 lda mon+2,x
  286. 3850 and #$bf
  287. 3860 sta $414
  288. 3870 !
  289. 3880 ! the following is crucial
  290. 3890 !
  291. 3900 lda #$81
  292. 3910 sta $dc0e
  293. 3920 ldx #255
  294. 3930 tax
  295. 3940 cbm sta $1800,x  ! clear bam
  296. 3950 dex
  297. 3960 bne cbm
  298. 3970 lda #0
  299. 3980 jsr $ff90     ! turn off messages
  300. 3990 ldx #<bam
  301. 4000 ldy #>bam      ! load page table
  302. 4010 lda #1
  303. 4020 jsr d(NULL)
  304. 4030 ldx #<index    ! load main page
  305. 4040 ldy #>index    ! p100  @ $800
  306. 4050 lda #1
  307. 4060 jsr d(NULL)
  308. 4070 lda #8         ! p100 --> $1000
  309. 4080 ldx #8
  310. 4090 ldy #$10
  311. 4100 jsr move
  312. 4110 jsr sach
  313. 4120 gk jsr $ffe4
  314. 4130 cmp #0
  315. 4140 bne gl
  316. 4150 sta ro
  317. 4160 jmp gk
  318. 4170 gl cmp #$20       ! reveal key?
  319. 4180 bne gk2
  320. 4190 lda #1
  321. 4200 sta ro         ! reveal on
  322. 4210 lm lda $dc01  ! lock mode
  323. 4220 and #$10
  324. 4230 beq lm
  325. 4240 jmp gk
  326. 4250 gk2 cmp #136   ! cancel?
  327. 4260 bne chl
  328. 4270 jmp ent      ! end 64-tel
  329. 4280 chl cmp #80  ! p' pages available
  330. 4290 bne chk
  331. 4300 jsr dp  ! display pages
  332. 4310 jmp gk
  333. 4320 chk cmp #133   ! f1 ?
  334. 4330 bne ch2
  335. 4340 jsr stl   ! save top line
  336. 4350 jsr edit  ! to editor
  337. 4360 jsr rtl   ! restore
  338. 4370 jmp gk
  339. 4380 ch2 cmp #$31    ! '1' ?
  340. 4390 bne gk
  341. 4400 ldx $7eb
  342. 4410 stx cp     ! current page
  343. 4420 jsr f7
  344. 4430 ldx $7eb
  345. 4440 cpx cp
  346. 4450 beq gk     ! select same page
  347. 4460 cpx #100
  348. 4470 beq ind
  349. 4480 lda $1800,x   ! page exist ?
  350. 4490 bne ch3
  351. 4500 ind lda #8
  352. 4510 ldx #$10
  353. 4520 ldy #$08
  354. 4530 jsr move
  355. 4540 jsr sach    ! scn & col handler
  356. 4550 jmp gk
  357. 4560 ch3 lda #0
  358. 4570 sta $7ec
  359. 4580 ldx #$eb
  360. 4590 ldy #7
  361. 4600 lda #1
  362. 4610 jsr d(NULL)
  363. 4620 jsr sach
  364. 4630 jmp gk
  365. 4640 dp jsr stl
  366. 4650 jsr $e544  ! display pages
  367. 4660 lda $7e9      ! store f/r mode
  368. 4670 sta dtp+1
  369. 4680 lda #0        ! set reveal mode
  370. 4690 sta $7e9
  371. 4700 lda #19  ! home
  372. 4710 jsr $e716
  373. 4720 lda #17
  374. 4730 jsr $e716
  375. 4740 ldx #100
  376. 4750 dpl stx dtp
  377. 4760 lda $1800,x
  378. 4770 beq dpl2
  379. 4780 lda #0
  380. 4790 jsr $bdcd
  381. 4800 lda #32
  382. 4810 jsr $e716
  383. 4820 dpl2 ldx dtp
  384. 4830 inx
  385. 4840 cpx #200    ! reached page 200?
  386. 4850 bne dpl
  387. 4860 dpl3 jsr $ffe4
  388. 4870 cmp #0         ! wait for key
  389. 4880 beq dpl3
  390. 4890 lda dtp+1
  391. 4900 sta $7e9
  392. 4910 jmp sach+3
  393. 4920 stl ldx #$27
  394. 4930 st2 lda $400,x
  395. 4940 sta stt,x
  396. 4950 lda $d800,x    ! save table
  397. 4960 sta ctt,x
  398. 4970 dex
  399. 4980 bpl st2
  400. 4990 rts
  401. 5000 dtp byt 0,0
  402. 5010 stt byt "                                          "
  403. 5020 ctt byt "                                          "
  404. 5030 rtl ldx #$27
  405. 5040 rt2 lda stt,x
  406. 5050 sta $400,x
  407. 5060 lda #$60
  408. 5070 sta $7c0,x
  409. 5080 lda ctt,x
  410. 5090 sta $d800,x
  411. 5100 dex
  412. 5110 bpl rt2
  413. 5120 rts
  414. 5130 sach jsr stl
  415. 5140 lda #4
  416. 5150 ldx #8
  417. 5160 ldy #4
  418. 5170 jsr move      ! copy --> screen
  419. 5180 lda #4
  420. 5190 ldx #12
  421. 5200 ldy #$d8
  422. 5210 jsr move      ! colour --> rom
  423. 5220 lda #4
  424. 5230 sta sss+2
  425. 5240 lda #12
  426. 5250 sta scc+2
  427. 5260 ldy #$28
  428. 5270 scc lda $8000,y
  429. 5280 and #$80
  430. 5290 beq sch2
  431. 5300 lda #$60
  432. 5310 sss sta $0400,y
  433. 5320 sch2 iny
  434. 5330 beq ipp
  435. 5340 cpy #$e8
  436. 5350 beq sch3
  437. 5360 jmp scc
  438. 5370 ipp inc scc+2  ! inc. pointers
  439. 5380 inc sss+2
  440. 5390 jmp scc
  441. 5400 sch3 lda sss+2
  442. 5410 cmp #7
  443. 5420 bne scc
  444. 5430 lda $be8
  445. 5440 sta irc+1
  446. 5450 lda $7ea
  447. 5460 jsr tlc    ! set case
  448. 5470 jmp rtl
  449. 5480 !
  450. 5490 ! this section is  the page
  451. 5500 ! editor program. later on it
  452. 5510 ! will be added to the main code
  453. 5520 !
  454. 5530 !
  455. 5540 edit lda #19     !home
  456. 5550 jsr $e716
  457. 5560 lda #17
  458. 5570 jsr $e716
  459. 5580 lda #0
  460. 5590 sta $7e9    ! auto reveal mode
  461. 5600 sta $7e8    ! black screen
  462. 5610 sta $7ea    ! lowercase
  463. 5620 jsr tlc    ! to lowercase
  464. 5630 ed1 lda 214
  465. 5640 bne ed2    ! cursor on top line?
  466. 5650 lda #17
  467. 5660 jmp ed3
  468. 5670 ed2 sec
  469. 5680 cmp #24
  470. 5690 bcc ed4
  471. 5700 lda #145
  472. 5710 ed3 jsr $e716
  473. 5720 ed4 ldy $d3
  474. 5730 lda ($d1),y
  475. 5740 eor #$80
  476. 5750 sta ($d1),y
  477. 5760 ed4t jsr $ffe4  ! get chars
  478. 5770 cmp #0
  479. 5780 bne ed4s
  480. 5790 ldx #1
  481. 5800 lme lda $dc01   ! lock mode
  482. 5810 cmp #223
  483. 5820 bne lmo
  484. 5830 stx ro
  485. 5840 jmp lme
  486. 5850 lmo dex
  487. 5860 stx ro
  488. 5870 jmp ed4t
  489. 5880 ed4s pha
  490. 5890 ldy $d3
  491. 5900 lda ($d1),y
  492. 5910 eor #$80
  493. 5920 sta ($d1),y
  494. 5930 pla
  495. 5940 cmp #133    ! f1 ?
  496. 5950 bpl ed6
  497. 5960 ed5 jsr $e716
  498. 5970 jmp ed1
  499. 5980 ed6 cmp #141  ! f8 ?
  500. 5990 bpl ed5
  501. 6000 sec
  502. 6010 sbc #133
  503. 6020 asl a
  504. 6030 tax
  505. 6040 jsr fm      ! function message
  506. 6050 lda dvt,x   ! dispatch vector
  507. 6060 ldy dvt+1,x   ! table
  508. 6070 sta ed7+1
  509. 6080 sty ed7+2
  510. 6090 ed7 jsr $8000
  511. 6100 nop
  512. 6110 jmp ed1
  513. 6120 fm lda mvt,x  ! message vector
  514. 6130 sta pku+1     ! pick up char.
  515. 6140 lda mvt+1,x
  516. 6150 sta pku+2
  517. 6160 ldy #0
  518. 6170 pku lda $8000,y
  519. 6180 beq fme    ! end
  520. 6190 cmp #$40
  521. 6200 bmi pk2
  522. 6210 sec
  523. 6220 sbc #$40
  524. 6230 pk2 sta $7c0,y
  525. 6240 lda #4
  526. 6250 sta $dbc0,y
  527. 6260 iny
  528. 6270 jmp pku
  529. 6280 fme rts
  530. 6290 mvt wor x1,x3,x5,x7,x2,x4,x6,x8
  531. 6300 x1 byt "return to 64-tel        ",0
  532. 6310 x2 byt "change screen colour    ",0
  533. 6320 x3 byt "toggle upper/lowercase  ",0
  534. 6330 x4 byt "removing page from disk ",0
  535. 6340 x5 byt "toggle flash/reveal     ",0
  536. 6350 x6 byt "saving page to disk     ",0
  537. 6360 x7 byt "new page number         ",0
  538. 6370 x8 byt "screen copied to ram    ",0
  539. 6380 dvt wor f1,f3,f5,f7,f2,f4,f6,f8
  540. 6390 jmp ed1        ! checks later
  541. 6400 !
  542. 6410 ! move blocks of memory
  543. 6420 !
  544. 6430 move cmp #0
  545. 6440 bne mv1
  546. 6450 rts
  547. 6460 mv1 stx mv2+2
  548. 6470 sty mv2+5
  549. 6480 tax
  550. 6490 ldy #0
  551. 6500 mv2 lda $8000,y
  552. 6510 sta $8000,y
  553. 6520 iny
  554. 6530 bne mv2
  555. 6540 inc mv2+2
  556. 6550 inc mv2+5
  557. 6560 dex
  558. 6570 bne mv2
  559. 6580 rts
  560. 6590 !
  561. 6600 ! function key routines
  562. 6610 !
  563. 6620 f1 pla       ! return to 64-tel
  564. 6630 pla
  565. 6640 rts
  566. 6650 f2 inc irc+1  ! colour change
  567. 6660 lda irc+1
  568. 6670 sta $7e8
  569. 6680 rts
  570. 6690 f3 lda $7ea  ! change case
  571. 6700 eor #1
  572. 6710 sta $7ea
  573. 6720 tlc tax
  574. 6730 lda bc,x
  575. 6740 jmp $e716
  576. 6750 bc byt 14,142
  577. 6760 f5 lda $7e9   ! flash/reveal mode
  578. 6770 eor #1
  579. 6780 sta $7e9
  580. 6790 rts
  581. 6800 f7 lda #$60   ! new page no.
  582. 6810 sta $402
  583. 6820 sta $403
  584. 6830 lda #$31
  585. 6840 sta $401
  586. 6850 jsr gend
  587. 6860 sta ten
  588. 6870 clc
  589. 6880 adc #$30
  590. 6890 sta $402
  591. 6900 jsr gend
  592. 6910 sta un
  593. 6920 clc
  594. 6930 adc #$30
  595. 6940 sta $403
  596. 6950 jsr evn
  597. 6960 clc
  598. 6970 adc #100
  599. 6980 sta $7eb
  600. 6990 rts
  601. 7000 f8 lda #4  ! scrn --> copy
  602. 7010 ldx #4
  603. 7020 ldy #$08
  604. 7030 jmp move
  605. 7040 f6 jsr f4
  606. 7050 ldx #4
  607. 7060 f6e lda $7e8,x   ! essentials
  608. 7070 sta $be8,x
  609. 7080 dex
  610. 7090 bpl f6e
  611. 7100 lda #4  ! save page to disk
  612. 7110 sta f6s+2
  613. 7120 lda #8
  614. 7130 sta f6c+2
  615. 7140 lda #$0c
  616. 7150 sta f6t+2
  617. 7160 lda #$d8
  618. 7170 sta f6r+2
  619. 7180 ldy #0
  620. 7190 f6s lda $8000,y ! get colour
  621. 7200 f6c cmp $8000,y ! any match
  622. 7210 php
  623. 7220 f6r lda $8000,y
  624. 7230 and #15
  625. 7240 plp
  626. 7250 beq f6t
  627. 7260 ora #$80
  628. 7270 f6t sta $8000,y
  629. 7280 iny
  630. 7290 bne f6s
  631. 7300 inc f6s+2
  632. 7310 inc f6c+2
  633. 7320 inc f6t+2
  634. 7330 inc f6r+2
  635. 7340 lda f6s+2
  636. 7350 cmp #8
  637. 7360 bne f6s
  638. 7370 tax
  639. 7380 lda #1
  640. 7390 ldy #255
  641. 7400 jsr $ffba
  642. 7410 ldx $beb
  643. 7420 stx dnam+2
  644. 7430 ldx #<dnam
  645. 7440 ldy #>dnam
  646. 7450 lda #3
  647. 7460 jsr $ffbd
  648. 7470 ldx #$f5
  649. 7480 ldy #$0f
  650. 7490 lda #0
  651. 7500 sta $fb
  652. 7510 lda #$08
  653. 7520 sta $fc
  654. 7530 lda #$fb
  655. 7540 jsr $ffd8    ! save $800 - $1000
  656. 7550 ldx $beb
  657. 7560 lda #$ff
  658. 7570 sta $1800,x  ! this page filled
  659. 7580 lda $7eb  ! new index page ?
  660. 7590 cmp #100
  661. 7600 bne nni   ! no
  662. 7610 lda #8
  663. 7620 ldx #$8
  664. 7630 ldy #$10
  665. 7640 jsr move
  666. 7650 nni rts
  667. 7660 dnam byt "@:x"
  668. 7670 f4 ldx $7eb   ! scratch a 64-tel
  669. 7680               ! page
  670. 7690 lda $1800,x   ! does page exist?
  671. 7700 bne f41
  672. 7710 rts
  673. 7720 f41 lda #0
  674. 7730 sta $1800,x   ! page now free
  675. 7740 stx com+3
  676. 7750 lda #4
  677. 7760 ldy #>com
  678. 7770 ldx #<com
  679. 7780 jsr $ffbd     ! "@s0:x"
  680. 7790 lda #15
  681. 7800 ldx #8
  682. 7810 ldy #15
  683. 7820 jsr $ffba     ! setlfs
  684. 7830 jsr $ffc0     ! send disk command
  685. 7840 lda #15
  686. 7850 jsr $ffc3     ! close file
  687. 7860 rts
  688. 7870 com byt "s0:a"
  689. 7880 d(NULL) jsr $ffbd   ! disk load
  690. 7890 ldx #8
  691. 7900 lda #1
  692. 7910 ldy #255
  693. 7920 jsr $ffba
  694. 7930 lda #0
  695. 7940 jmp $ffd5
  696. 7950 ent ldx #8       ! end of 64-tel
  697. 7960 lda #1
  698. 7970 ldy #255
  699. 7980 jsr $ffba
  700. 7990 ldx #66
  701. 8000 stx dnam+2
  702. 8010 ldx #<dnam
  703. 8020 ldy #>dnam
  704. 8030 lda #3
  705. 8040 jsr $ffbd
  706. 8050 ldx #$f5
  707. 8060 ldy #$18
  708. 8070 lda #0
  709. 8080 sta $fb
  710. 8090 lda #$18
  711. 8100 sta $fc
  712. 8110 lda #$fb
  713. 8120 jsr $ffd8    ! save $1800 - $1900
  714. 8130 lda #0
  715. 8140 sta $7e9
  716. 8150 jmp $e544
  717.